export type Result<T = unknown> = {
  code: number
  msg: string
  data: T
}

// page model for mybatis pagination
/**
 * {
        "records": [],
        "total": 0,
        "size": 10,
        "current": 1,
        "orders": [],
        "optimizeCountSql": true,
        "searchCount": true,
        "optimizeJoinOfCountSql": true
    }
 */
export type ResPage<T = unknown> = {
  current: number
  pages: number
  records: T[]
  size: number
  total: number
}

export type ReqPage = {
  size: number
  current: number
  likeAll?: string
  search?: Map<string, string>
  orders?: Map<string, boolean>
}

export type SearchItem = {
  column: string | 'all'
  value: string
}

export type OrderItem = {
  column: string
  asc: boolean
}
